<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

</body>
<script>
let obj = {username: 'zs', age: 20, data: {data: 'abc'}}
//不用解构
/*
let username = obj.username
let age = obj.age
*/
//用解构
// let {username, age} = obj
//层层解构
let {data: {data}} = obj
console.log(data)//abc
</script>
</html>
